# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-sound/pd/pd-0.38.4.ebuild,v 1.3 2005/11/02 18:14:30 gustavoz Exp $

IUSE="alsa jack"

DESCRIPTION="PiDiP Is Definitely In Pieces."
HOMEPAGE="http://ydegoyon.free.fr/pidip.html"
SRC_URI="http://ydegoyon.free.fr/${P}.tar.gz
		http://www-crca.ucsd.edu/~msp/Software/pd-0.39-1.src.tar.gz
		http://zwizwa.fartit.com/pd/pdp/pdp-0.12.4.tar.gz
		http://tdegoyon.free.fr/ffmpeg-cvs-2003-03-04.tar.gz"
S=${WORKDIR}/${PN}
LICENSE="|| ( BSD as-is )"
SLOT="0"
KEYWORDS="~amd64 ~ppc sparc x86"

DEPEND="media-sound/pd
	alsa? ( >=media-libs/alsa-lib-0.9.0_rc2 )
	jack? ( >=media-sound/jack-audio-connection-kit-0.99.0-r1 )"

src_compile() {
	local myconf
	myconf="--with-pd=../pd-0.39-1 --with-pdp=../pdp-0.12.4 --with-ffmpeg=../ffmpeg-cvs-2003-03-04"

	econf \
		${myconf} \
		$(use_enable jack) \
		$(use_enable alsa) \
		|| die "./configure failed"
	emake || die "parallel make failed"
}

src_install() {
	insinto /usr/lib/pd/extra
	doins pidip.pd_linux

	insinto /usr/lib/pd/extra/pidip
	doins patches/*
	make DESTDIR=${D} install || die "install failed"

}
